
// 模拟导出方法
function downBlob(url) {
    var xhr = new XMLHttpRequest();
    xhr.open('GET', url, true);    // 也可用POST方式
    xhr.responseType = "blob";
    // $.modal.loading("正在导出，请稍后...")
    xhr.onload = function () {
        if (this.status === 200) {
            var blob = this.response;
            if (navigator.msSaveBlob == null) {
                var a = document.createElement('a');
                var headerName = xhr.getResponseHeader("Content-disposition");
                a.download = decodeURIComponent(headerName).substring(20);
                a.href = URL.createObjectURL(blob);
                $("body").append(a);    // 修复firefox中无法触发click
                a.click();
                URL.revokeObjectURL(a.href);
                $(a).remove();
            } else {
                navigator.msSaveBlob(blob, decodeURIComponent(headerName).substring(20));
            }
        }
        // $.modal.closeLoading()
    };
    xhr.send()
}